package bb.lanxing.lib.devices.ble.x1;

import android.os.Binder;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;

public interface IRemoteX1Contraoller extends IInterface {


    class Default implements IRemoteX1Contraoller {
        @Override
        public IBinder asBinder() {
            return null;
        }

        @Override
        public boolean isConnected() throws RemoteException {
            return false;
        }

        @Override
        public void reset(X1DisplayData x1DisplayData) throws RemoteException {
        }

        @Override
        public void send(X1DisplayData x1DisplayData) throws RemoteException {
        }

        @Override
        public void set(int i, float f, int i2) throws RemoteException {
        }

        @Override
        public void stop() throws RemoteException {
        }
    }

    boolean isConnected() throws RemoteException;

    void reset(X1DisplayData x1DisplayData) throws RemoteException;

    void send(X1DisplayData x1DisplayData) throws RemoteException;

    void set(int i, float f, int i2) throws RemoteException;

    void stop() throws RemoteException;

    abstract class Stub extends Binder implements IRemoteX1Contraoller {
        private static final String DESCRIPTOR = "bb.lanxing.lib.devices.ble.x1.IRemoteX1Contraoller";
        static final int TRANSACTION_set = 1;
        static final int TRANSACTION_reset = 2;
        static final int TRANSACTION_send = 3;
        static final int TRANSACTION_stop = 4;
        static final int TRANSACTION_isConnected = 5;

        @Override
        public IBinder asBinder() {
            return this;
        }

        public Stub() {
            attachInterface(this, DESCRIPTOR);
        }

        public static IRemoteX1Contraoller asInterface(IBinder iBinder) {
            if (iBinder == null) {
                return null;
            }
            IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR);
            if ((queryLocalInterface instanceof IRemoteX1Contraoller)) {
                return (IRemoteX1Contraoller) queryLocalInterface;
            }
            return new Proxy(iBinder);
        }

        @Override
        public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException {
            if (i == TRANSACTION_set) {
                parcel.enforceInterface(DESCRIPTOR);
                set(parcel.readInt(), parcel.readFloat(), parcel.readInt());
                parcel2.writeNoException();
                return true;
            }
            X1DisplayData x1DisplayData = null;
            if (i == TRANSACTION_reset) {
                parcel.enforceInterface(DESCRIPTOR);
                if (parcel.readInt() != 0) {
                    x1DisplayData = X1DisplayData.CREATOR.createFromParcel(parcel);
                }
                reset(x1DisplayData);
                parcel2.writeNoException();
                return true;
            } else if (i == TRANSACTION_send) {
                parcel.enforceInterface(DESCRIPTOR);
                if (parcel.readInt() != 0) {
                    x1DisplayData = X1DisplayData.CREATOR.createFromParcel(parcel);
                }
                send(x1DisplayData);
                parcel2.writeNoException();
                return true;
            } else if (i == TRANSACTION_stop) {
                parcel.enforceInterface(DESCRIPTOR);
                stop();
                parcel2.writeNoException();
                return true;
            } else if (i == TRANSACTION_isConnected) {
                parcel.enforceInterface(DESCRIPTOR);
                boolean isConnected = isConnected();
                parcel2.writeNoException();
                parcel2.writeInt(isConnected ? 1 : 0);
                return true;
            } else {
                if (i == INTERFACE_TRANSACTION) {
                    parcel2.writeString(DESCRIPTOR);
                    return true;
                }
                return super.onTransact(i, parcel, parcel2, i2);
            }
        }

        public static class Proxy implements IRemoteX1Contraoller {
            public static IRemoteX1Contraoller sDefaultImpl;
            private final IBinder mRemote;

            public String getInterfaceDescriptor() {
                return Stub.DESCRIPTOR;
            }

            Proxy(IBinder iBinder) {
                this.mRemote = iBinder;
            }

            @Override
            public IBinder asBinder() {
                return this.mRemote;
            }

            @Override
            public void set(int i, float f, int i2) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    obtain.writeInt(i);
                    obtain.writeFloat(f);
                    obtain.writeInt(i2);
                    if (!this.mRemote.transact(TRANSACTION_set, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().set(i, f, i2);
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void reset(X1DisplayData x1DisplayData) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (x1DisplayData != null) {
                        obtain.writeInt(1);
                        x1DisplayData.writeToParcel(obtain, 0);
                    } else {
                        obtain.writeInt(0);
                    }
                    if (!this.mRemote.transact(TRANSACTION_reset, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().reset(x1DisplayData);
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void send(X1DisplayData x1DisplayData) throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (x1DisplayData != null) {
                        obtain.writeInt(1);
                        x1DisplayData.writeToParcel(obtain, 0);
                    } else {
                        obtain.writeInt(0);
                    }
                    if (!this.mRemote.transact(TRANSACTION_send, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().send(x1DisplayData);
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public void stop() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    if (!this.mRemote.transact(TRANSACTION_stop, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        Stub.getDefaultImpl().stop();
                    } else {
                        obtain2.readException();
                    }
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }

            @Override
            public boolean isConnected() throws RemoteException {
                Parcel obtain = Parcel.obtain();
                Parcel obtain2 = Parcel.obtain();
                try {
                    obtain.writeInterfaceToken(Stub.DESCRIPTOR);
                    boolean z = false;
                    if (!this.mRemote.transact(TRANSACTION_isConnected, obtain, obtain2, 0) && Stub.getDefaultImpl() != null) {
                        return Stub.getDefaultImpl().isConnected();
                    }
                    obtain2.readException();
                    if (obtain2.readInt() != 0) {
                        z = true;
                    }
                    return z;
                } finally {
                    obtain2.recycle();
                    obtain.recycle();
                }
            }
        }

        public static boolean setDefaultImpl(IRemoteX1Contraoller iRemoteX1Contraoller) {
            if (Proxy.sDefaultImpl == null) {
                if (iRemoteX1Contraoller == null) {
                    return false;
                }
                Proxy.sDefaultImpl = iRemoteX1Contraoller;
                return true;
            }
            throw new IllegalStateException("setDefaultImpl() called twice");
        }

        public static IRemoteX1Contraoller getDefaultImpl() {
            return Proxy.sDefaultImpl;
        }
    }
}
